package com.gougou.front.web.mq.handler;

import com.gougou.redis.service.RedisService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @ClassName ContentMQHandler
 * @Description TODO
 * @Author c
 * @Date 2018/10/8 9:46
 * @Vcrsion 1.0
 **/
@Component
public class ContentMQHandler {
    @Autowired
    private RedisService redisService;

    /**
     * 删除缓存中的商品数据，完成数据同步
     *
     * @param msg
     */
    @RabbitListener(queues = "GOUGOU-FRONT-CONTENT-QUEUE")
    public void execute(String msg) {
        try {
            String key = "ad1jsonStr";
            this.redisService.del(key);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
